import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'umi'
import { Page } from 'components'
import { Avatar, Descriptions } from 'antd'
import { t } from "@lingui/macro"
import {getNavigationTreeTitle} from "utils/tree";

@connect(({ exampleCategoryDetail }) => ({ exampleCategoryDetail }))
class ExampleCategoryDetail extends PureComponent {
  render() {
    const { exampleCategoryDetail } = this.props
    const { data,options,trees } = exampleCategoryDetail
    return (
      <Page inner>
        {/*<div className={styles.content}>{content}</div>*/}
        <Descriptions title={t`自动化样例分类表`}>
          {/*{content}*/}
          <Descriptions.Item label={t`Id`}>{data.id}</Descriptions.Item>
          <Descriptions.Item label={t`Title`}>{data.title}</Descriptions.Item>
          <Descriptions.Item label={t`Parent Category`}>{getNavigationTreeTitle(data.parentId,trees.parentId)}</Descriptions.Item>
          <Descriptions.Item label={t`Updated Time`}>{data.updatedTime}</Descriptions.Item>
          <Descriptions.Item label={t`Created Time`}>{data.createdTime}</Descriptions.Item>
          <Descriptions.Item label={t`Only Date`}>{data.onlyDate}</Descriptions.Item>
          <Descriptions.Item label={t`Pay Datetime`}>{data.payDatetime}</Descriptions.Item>
          <Descriptions.Item label={t`Img`}>{data.img}</Descriptions.Item>
        </Descriptions>
      </Page>
    )
  }
}

ExampleCategoryDetail.propTypes = {
  exampleCategoryDetail: PropTypes.object,
}

export default ExampleCategoryDetail
